package ooday05;

public class EnumDemo {
    public static void main(String[] args) {
        Season s=Season.WINTER;
        System.out.println(s.getSeasonDesc());
        System.out.println(s.getSeasonName());
        Season[] seasons=Season.values();

        for(int i=0;i< seasons.length;i++){
            System.out.print(seasons[i]+" ");
            System.out.print(seasons[i].getSeasonName()+" ");
            System.out.println(seasons[i].getSeasonDesc());
        }

        Season a=Season.valueOf("SPRING");//获取一个对象和Season s=Season.SPRING;一样
        System.out.println(a.getSeasonDesc());

        switch (s){
            case AUTUMN:
                System.out.println(s.getSeasonDesc()+"秋收");
                break;
            case SUMMER:
                System.out.println(s.getSeasonDesc()+"吃雪糕");
                break;
            case SPRING:
                System.out.println(s.getSeasonDesc()+"春游");
                break;
            case WINTER:
                System.out.println(s.getSeasonDesc()+"打雪仗");
                break;
        }


    }
}
